from ronglian_sms_sdk import SmsSDK

accId = '2c94811c9860a9c40198e00d107e1486'
accToken = 'ca0843027e5a45a1a430de2bfb7fca96'
appId = '2c94811c9860a9c40198e00d1275148d'


class SmsCode:
    def send(self,phone,code):
        #初始化实例
        sdk = SmsSDK(accId, accToken, appId)
        tid = "1"  # 测试账号只能用1
        mobile = phone
        datas = (code,)
        resp = sdk.sendMessage(tid, mobile, datas)
        return resp
sms=SmsCode()
# def send_message(phone, code):
#     sdk = SmsSDK(accId, accToken, appId)
#     tid = '1'
#     mobile = phone
#     datas = (code,)
#     resp = sdk.sendMessage(tid, mobile, datas)
#     print(resp)
#
#
# send_message('18738708301', '7865')
